Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tctl: add a --with-secrets flag to tctl tokens ls #47356

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

zmb3
Copy link
Collaborator

@zmb3 zmb3 commented Oct 8, 2024

Show the "safe name" for tokens by default, which is the name of the token for non-sensitive join tokens, and a redacted version of the name for shared secret tokens.

Note: for --format=json or --format=yaml we currently maintain the original behavior (always show the raw token contents). The tctl get tokens command has also not been touched - it continues to return the raw token resource from the backend.

This also fixes a bug where we used to show Unix time zero as the expiry, because we were only checking for time.IsZero (Go's zero time is not the same as Unix zero time).

Updates #47254

Screenshot 2024-10-08 at 12 18 24 PM

Changelog: The tctl tokens ls command redacts secret join tokens by default. To include the token values, provide the new --with-secrets flag.

Show the "safe name" for tokens by default, which is the name of
the token for non-sensitive join tokens, and a redacted version
of the name for shared secret tokens.

Note: for --format=json or --format=yaml we currently maintain
the original behavior (always show the raw token contents).
The tctl get tokens command has also not been touched - it
continues to return the raw token resource from the backend.

Updates #47254
@github-actions github-actions bot added size/sm tctl tctl - Teleport admin tool labels Oct 8, 2024
Copy link

github-actions bot commented Oct 8, 2024

The PR changelog entry failed validation: Changelog entry not found in the PR body. Please add a "no-changelog" label to the PR, or changelog lines starting with changelog: followed by the changelog entries for the PR.

1 similar comment
Copy link

github-actions bot commented Oct 8, 2024

The PR changelog entry failed validation: Changelog entry not found in the PR body. Please add a "no-changelog" label to the PR, or changelog lines starting with changelog: followed by the changelog entries for the PR.

@public-teleport-github-review-bot public-teleport-github-review-bot bot removed the request for review from avatus October 8, 2024 19:25
@zmb3 zmb3 added this pull request to the merge queue Oct 8, 2024
Merged via the queue into master with commit a923ce7 Oct 8, 2024
40 of 42 checks passed
@zmb3 zmb3 deleted the zmb3/tctl-token-secrets branch October 8, 2024 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants